home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 235 / Issue 235 - September 2007 - DPCS0907DVD.ISO / Extras / NetObjects Fusion / NOF10.exe / data1.cab / FSI / lib / nof / ui / Dialog.js next >
Encoding:
Text File  |  2007-04-11  |  2.1 KB  |  86 lines

  1. /****i* SOURCE_FILE/INFO
  2.     *
  3.     * NAME
  4.     *  Dialog.js
  5.     *
  6.     * USAGE
  7.     *  Part of Netobjects JavaScript Library.
  8.     *
  9.     * COPYRIGHT
  10.     *  Copyright ⌐ 2000-2005 Website Pros, Inc.
  11.     *  All Rights Reserved.
  12.     *
  13.     *  This is an unpublished work protected by Website Pros, Inc.
  14.     *  as a trade secret, and is not to be used or disclosed except as
  15.     *  expressly provided in a written license agreement executed by
  16.     *  you and Website Pros, Inc.
  17.     *
  18.     *      <copyright@websitepros.com>
  19.     *
  20.     * NOTES
  21.     *  JavaScript code.
  22.     *
  23.     *****/
  24.  
  25. if (!IS_isModuleInitialized("IS.NOF.UI.Dialog"))
  26. {
  27.     
  28.     /****h* NOF_JavaScript_Library/NOF.UI.Dialog
  29.     *
  30.     * NAME
  31.     *  NOF.UI.Dialog
  32.     *
  33.     * DESCRIPTION
  34.     *
  35.     * External dependencies: NOF.HTML.EditorWindow, NOF.WindowEvent
  36.     ****/
  37.     
  38.     /**
  39.     * Constructor    
  40.     **/      
  41.     function NOF_UI_Dialog (_editedElem, _document, _name) {
  42.         this.__proto__ = NOF_UI_Dialog.prototype;
  43.         this.SUPER ( _editedElem, _document, _name );    
  44.     }    
  45.     NOF_UI_Dialog.inherits( NOF.HTML.EditorWindow )
  46.     {
  47.         
  48.         var method = NOF_UI_Dialog.prototype;
  49.         
  50.         method.onLoad   = function () {
  51.         }    
  52.         
  53.         method.onUnload = function () {
  54.             this.onClose(new NOF.WindowEvent( NOF.WindowEvent.DIALOG_CLOSED, this));
  55.             this.setEditedElement( null );
  56.             this.release();
  57.         }
  58.         
  59.         method.onOk     = function () {
  60.             this.notifyListeners( new NOF.WindowEvent(NOF.WindowEvent.DIALOG_OK, this) );
  61.             this.close();
  62.         }
  63.         method.onCancel = function () {
  64.             this.notifyListeners( new NOF.WindowEvent(NOF.WindowEvent.DIALOG_CANCEL, this) );
  65.             this.close();
  66.         }
  67.         
  68.         method.close = function (){
  69.             this.doc.getRawDoc().parentWindow.close();
  70.         }
  71.         
  72.         method.super_getResourceProperty = method.getResourceProperty;
  73.         method.getResourceProperty = function ( key ) {
  74.             var resourceProperty = this.super_getResourceProperty( this.getName() + "." + key );
  75.             if ( resourceProperty != null && resourceProperty.length > 0 ) {
  76.                 return resourceProperty;
  77.             }
  78.             else {
  79.                 return this.super_getResourceProperty ( key );
  80.             }
  81.         }
  82.     }
  83.     
  84.     NOF.UI.__proto__.Dialog = NOF_UI_Dialog;
  85. }
  86.